package com.gamejelly.proxy.client;

import lombok.Data;

import java.lang.reflect.Method;
import java.util.concurrent.CompletableFuture;

@Data
public class Caller {

    String className;

    String methodName;

    Class<?>[] paramTypes;

    Class<?> returnType;

    public Caller(Class<?> itf, Method method) {
        this.className = itf.getSimpleName();
        this.methodName = method.getName();
        this.paramTypes = method.getParameterTypes();
        this.returnType = method.getReturnType();
    }

    public boolean isVoid() {
        return returnType.equals(Void.class);
    }

    public boolean isAsync() {
        return returnType.equals(CompletableFuture.class);
    }
}
